gtk: Don't use gtk_render_activity()
authorBenjamin Otte <otte@redhat.com>
Thu, 14 Aug 2014 23:58:49 +0000 (01:58 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 16 Aug 2014 14:34:14 +0000 (16:34 +0200)
... in places where we draw a background. This was changed for GTK 3.0.0
to allow animations, but these days it doesn't make sense anymore to use
gtk_render_activity() for backgrounds.

gtk/deprecated/gtkstyle.c
gtk/gtkcellrendererprogress.c
gtk/gtkentry.c
gtk/gtkprogressbar.c
gtk/gtkrange.c

index d610a3417b7eedd02289263b7ee8f318d5d73b19..7a001bbf281dfd8e353e8e66545be771e9f0cdcf 100644 (file)
@@ -2045,15 +2045,10 @@ gtk_default_draw_box (GtkStyle      *style,
 
   cairo_save (cr);
 
-  if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_PROGRESSBAR))
-    gtk_render_activity (context, cr, x, y, width, height);
-  else
-    {
-      gtk_render_background (context, cr, x, y, width, height);
+  gtk_render_background (context, cr, x, y, width, height);
 
-      if (shadow_type != GTK_SHADOW_NONE)
-       gtk_render_frame (context, cr, x, y, width, height);
-    }
+  if (shadow_type != GTK_SHADOW_NONE)
+    gtk_render_frame (context, cr, x, y, width, height);
 
   cairo_restore (cr);
   gtk_style_context_restore (context);
index e452a9ad4b0435f32bee578137db58da1808b496..f8cb51d7fbb9b2287d4c10456d03d6e2f0c972d4 100644 (file)
@@ -626,15 +626,16 @@ gtk_cell_renderer_progress_render (GtkCellRenderer      *cell,
       clip.y = bar_position;
     }
 
-  gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
-
   if (bar_size > 0)
-    gtk_render_activity (context, cr,
-                         clip.x, clip.y,
-                         clip.width, clip.height);
+    {
+      gtk_style_context_save (context);
+      gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
 
-  gtk_style_context_restore (context);
+      gtk_render_background (context, cr, clip.x, clip.y, clip.width, clip.height);
+      gtk_render_frame (context, cr, clip.x, clip.y, clip.width, clip.height);
+
+      gtk_style_context_restore (context);
+    }
 
   if (priv->label)
     {
index 1e608490383666776d0a8369569c93897b14b409..5a9298cb7a0d895590e39bae7808288102751b17 100644 (file)
@@ -3937,8 +3937,8 @@ gtk_entry_draw_progress (GtkWidget       *widget,
     return;
  
   gtk_entry_prepare_context_for_progress (entry, context);
-  gtk_render_activity (context, cr,
-                       x, y, width, height);
+  gtk_render_background (context, cr, x, y, width, height);
+  gtk_render_frame (context, cr, x, y, width, height);
 
   gtk_style_context_restore (context);
 }
index 5cdda739aecb5617242cfa64ffe5b6e6ee321b4c..b2b24969a8bb9973dd9a36f9feac5f31157a66b8 100644 (file)
@@ -784,7 +784,8 @@ gtk_progress_bar_paint_activity (GtkProgressBar *pbar,
         gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
     }
 
-  gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
+  gtk_render_background (context, cr, area.x, area.y, area.width, area.height);
+  gtk_render_frame (context, cr, area.x, area.y, area.width, area.height);
 
   gtk_style_context_restore (context);
 }
@@ -849,7 +850,8 @@ gtk_progress_bar_paint_continuous (GtkProgressBar *pbar,
         gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
     }
 
-  gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
+  gtk_render_background (context, cr, area.x, area.y, area.width, area.height);
+  gtk_render_frame (context, cr, area.x, area.y, area.width, area.height);
 
   gtk_style_context_restore (context);
 }
index 19981e548381f0fa68aa6206d9d1b621b525418f..13f688716c44e49d40f8ea26ed13e50f1da8c917 100644 (file)
@@ -2159,9 +2159,8 @@ gtk_range_draw (GtkWidget *widget,
                 fill_y += priv->trough.height - fill_height;
             }
 
-          gtk_render_activity (context, cr,
-                               fill_x, fill_y,
-                               fill_width, fill_height);
+          gtk_render_background (context, cr, fill_x, fill_y, fill_width, fill_height);
+          gtk_render_frame (context, cr, fill_x, fill_y, fill_width, fill_height);
 
           gtk_style_context_restore (context);
         }